package edu.sctu.practice.class02.yangshengyu.sonOfFather;

/**
 * Created by Cullen on 2015/9/18.
 */
public class Dog2 extends Animal{
    public void eat(){
        System.out.print("狗狗的名字叫"+name+"年龄是"+age+"爱吃鱼！");
    }
    public static void main(String[] args) {

        Dog2 dog2 = new Dog2();                //子类可以拥有父类的所有属性和方法
        dog2.age = 2;
        dog2.name = "xiaodong";
        dog2.eat();
    }
}
